<script type="text/javascript">
    $(function() {
        $.fn.dataGridOptions.formSubFun("#form",'/modules/user/score/lottery/doAppend.html');
    });
</script>
<form id="form" method="post" enctype="multipart/form-data">
<div class="popForm sForm">
	<div class="formitm">
		<label class="lab">名称：</label>
		<div class="ipt"><input type="text" name="name" class="easyui-validatebox validatebox-text" data-options="required: true, validType:'maxLength[15]'"></div>
	</div>
	<div class="formitm">
		<label class="lab">状态：</label>
		<div class="ipt">
			<select name="status" id="status">
				<option value="1">启用</option>
				<option value="0">禁用</option>
			</select>
		</div>
	</div>
	<div class="formitm">
		<label class="lab">类型：</label>
		<div class="ipt">
			<select name="type" id="type">
				<option value="1">积分</option>
				<option value="2">现金</option>
			</select>
		</div>
	</div>
	<div class="formitm">
		<label class="lab">中奖率：</label>
		<div class="ipt"><input type="text" name="rate" id="rate" class="easyui-validatebox validatebox-text" onkeyup="if(this.value==this.value2);if(this.value.search(/^\d*(?:\.\d{0,2})?$/)==-1)this.value=(this.value2)?this.value2:'';else this.value2=this.value;" data-options="required: true,validType:'scoreRate[0.01,100]'" maxlength="5" style="width:80px;">&nbsp;%</div>
	</div>
	<div class="formitm">
		<label class="lab">中奖值：</label>
		<div class="ipt"><input type="text" name="value" id="value" class="easyui-validatebox validatebox-text" data-options="required: true, validType:'numOnly'" maxlength="6" style="width:80px;">&nbsp;<span id="unit">积分</span></div>
	</div>
</div>
 </form>
 <script>
 	var typeVal;
	$("#type").change(function(){
		typeVal=$(this).val();
		if(typeVal==1){
			$("#unit").text("积分");
		}else if(typeVal==2){
			$("#unit").text("元");
		}
	})
 </script>

